#include "smart_sensor.h"
#include <string.h>
#include "comfun.h"

sensor_device_t sensor_device[SENSOR_NUMS+1];


void smart_sensor_init(void)
{
	int i ;
	memset(sensor_device,0x00,sizeof(sensor_device));

	for(i=0;i<=SENSOR_NUMS;i++)
	{
		sensor_device[i].sno = i;
		put_le_val(i,sensor_device[i].aid,4);
		sensor_device[i].lux = 250;
		sensor_device[i].sun_light = 200;
        sensor_device[i].humi = 40.0;
        sensor_device[i].temp = 40.0;
	}
}

void smart_sensor_modify(int sno,uint32_t lux,uint32_t sun,float temp,float humi)
{
    sensor_device[sno].lux = lux;
    sensor_device[sno].sun_light = sun;
    sensor_device[sno].humi = humi;
    sensor_device[sno].temp = temp;

}
